import request from "@/utils/request";

export const registerApi = ({ username, password, captcha, captchaKey }) =>
  request.post("/user/register", { username, password, captcha, captchaKey });

export const loginApi = ({ username, password, captcha, captchaKey }) =>
  request.post("/user/login", { username, password, captcha, captchaKey });

export const getUserInfoApi = async () => request.get("/user/info");

// 上传服务
export const changeAvatarApi = async (formData) =>
  request.post("/user/changeAvatar", formData, {
    "Content-Type": "multipart/form-data",
  });

// 获取日志列表
export const getLogsApi = async (params) =>
  request.get("/user/logs", { params });

//获取日志类型
export const getLogTypeApi = async () => request.get("/user/log_levels");
